home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Text Editor / Source / TextEditorInit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-13  |  1.6 KB  |  68 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        TextEditorInit.cpp
  3.  
  4.     Contains:    CFM library init routine for TextEditor
  5.  
  6.     Written by:    Steve Smith
  7.  
  8.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12.  
  13. #ifndef _COMPILERDEFS_
  14. #include "CompDefs.h"
  15. #endif
  16.  
  17. // -- OpenDoc Utilities --
  18.  
  19. #ifndef _EXCEPT_
  20. // Exceptions define several important macros (e.g. CHECKENV)
  21. // which are used in the SOM method dispatch glue. If Except.h
  22. // is not included early enough, exceptions may not be thrown
  23. // correctly when returning from a SOM method with "ev" parameter set.
  24. #include <Except.h>
  25. #endif
  26.  
  27. // -- Macintosh Headers --
  28.  
  29. #ifndef __CODEFRAGMENTS__
  30. #include <CodeFragments.h>
  31. #endif
  32.  
  33. #ifndef _ODMEMORY_
  34. #include <ODMemory.h>
  35. #endif
  36.  
  37. #ifndef _USERSRCM_
  38. #include <UseRsrcM.h>
  39. #endif
  40.  
  41. #pragma segment TextEditorInit
  42.  
  43. //------------------------------------------------------------------
  44. // Prototypes
  45. //------------------------------------------------------------------
  46.  
  47. extern "C" pascal OSErr TextEditorCFMInit(CFragInitBlockPtr initBlkPtr);
  48.  
  49.  
  50. //------------------------------------------------------------------
  51. // Functions
  52. //------------------------------------------------------------------
  53.  
  54. extern "C" pascal OSErr TextEditorCFMInit(CFragInitBlockPtr initBlkPtr)
  55. {
  56.     // We are using OpenDoc's memory management calls, so we
  57.     // must initialize the interface to the memory manager.
  58.     OSErr err1 = InitODMemory();
  59.     // We must also capture the relevant information about
  60.     // our library file so that we may access our resources.
  61.     OSErr err2 = InitLibraryResources(initBlkPtr);
  62.     
  63.     return (OSErr) (err1 != noErr) ? err1 : err2;
  64. }
  65.  
  66.  
  67.  
  68.